﻿@model CultuRAM.Models.Parameter  
@{
    var id = ViewBag.IdParam;
    int idP = ViewBag.IdParam;
    int pag = ViewBag.Page;
}

<h4>Novo valor do Parâmetro</h4>
<br/><br />
@using (Ajax.BeginForm("CreateGeneric", "Parameters", new { idParam = idP, page = pag }, new AjaxOptions
{
    UpdateTargetId = "paramModalRight",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    OnSuccess = "UpdateListParamModal(" + pag + "," + idP + ")"
}))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>EventType</legend>
        
        @Html.HiddenFor(model => model.IdParam)
      @*  @Html.TextBox("page", pag, new {id="page"})*@

        @switch (idP)
        {
            case 1:

                <div class="editor-label">
                    @Html.LabelFor(model => model.WebpagesRole.RoleName)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.WebpagesRole.RoleName)
                    @Html.ValidationMessageFor(model => model.WebpagesRole.RoleName)
                </div>
                break;
            case 2:
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventType.Type)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.EventType.Type)
                    @Html.ValidationMessageFor(model => model.EventType.Type)
                </div>  
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventType.SuperType)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.EventType.SuperTypeId, (SelectList)ViewBag.SuperTypeId)          
                    @Html.ValidationMessageFor(model => model.EventType.SuperTypeId)
                </div> 

                break;
            case 3:
                <div class="editor-label">
                    @Html.LabelFor(model => model.ResourceType.ResType)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.ResourceType.ResType)
                    @Html.ValidationMessageFor(model => model.ResourceType.ResType)
                </div>
                break;
            case 4:
                <div class="editor-label">
                    @Html.LabelFor(model => model.EntityType.EntityTypeName)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.EntityType.EntityTypeName)
                    @Html.ValidationMessageFor(model => model.EntityType.EntityTypeName)
                </div>  
                break;
            case 5:
                <div class="editor-label">
                    @Html.LabelFor(model => model.ParticipantType.ParticipType)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.ParticipantType.ParticipType)
                    @Html.ValidationMessageFor(model => model.ParticipantType.ParticipType)
                </div> 
                break;
            case 6:
                <div class="editor-label">
                    @Html.LabelFor(model => model.AccreditingState.AccState)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.AccreditingState.AccState)
                    @Html.ValidationMessageFor(model => model.AccreditingState.AccState)
                </div> 
                break;
            case 7:
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventState.State)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.EventState.State)
                    @Html.ValidationMessageFor(model => model.EventState.State)
                </div> 
                break;
            case 8:
                <div class="editor-label">
                    @Html.LabelFor(model => model.City.CityName)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.City.CityName)
                    @Html.ValidationMessageFor(model => model.City.CityName)
                </div> 
                break;
            case 9:
                <div class="editor-label">
                    @Html.LabelFor(model => model.Place.NamePlace)
                </div>

                <div class="editor-field">
                    @Html.EditorFor(model => model.Place.NamePlace)
                    @Html.ValidationMessageFor(model => model.Place.NamePlace)
                </div> 
                break;
            case 10:
               <div class="editor-label">
                    @Html.LabelFor(model => model.Participant.Name)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Participant.Name)
                    @Html.ValidationMessageFor(model => model.Participant.Name)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.ParticipantType)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.Participant.ParticipantTypeId, (SelectList)ViewBag.ParticipantTypeId)    
                    @Html.ValidationMessageFor(model => model.Participant.ParticipantTypeId)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.Participant.Curriculum)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Participant.Curriculum)
                    @Html.ValidationMessageFor(model => model.Participant.Curriculum)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.Participant.Photo)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Participant.Photo)
                    @Html.ValidationMessageFor(model => model.Participant.Photo)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.Participant.Active)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.Participant.Active)
                    @Html.ValidationMessageFor(model => model.Participant.Active)
                </div>
                break;
            case 11:
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventProperty.Name)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.EventProperty.Name)
                    @Html.ValidationMessageFor(model => model.EventProperty.Name)
                </div> 
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventProperty.Kind)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.EventProperty.Kind, (SelectList)ViewBag.Kind)    
                    @Html.ValidationMessageFor(model => model.EventProperty.Kind)
                </div> 
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventProperty.DefaultValue)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.EventProperty.DefaultValue)
                    @Html.ValidationMessageFor(model => model.EventProperty.DefaultValue)
                </div> 
                <div class="editor-label">
                    @Html.LabelFor(model => model.EventProperty.Mandatory)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.EventProperty.Mandatory)
                    @Html.ValidationMessageFor(model => model.EventProperty.Mandatory)
                </div> 
                break;
            default:
                <div class="alert alert-danger"><br /><br />Sem dados... <br /><br /></div>
                break;
        }
    <br/>
        <p>
            <button class="btn btn-primary" value="Guardar" type="submit">Guardar</button>
                @Html.Raw(@Ajax.ActionLink("replacetxt", "DefaultRight", null, new AjaxOptions()
                            {
                                UpdateTargetId = "paramModalRight",
                                InsertionMode = InsertionMode.Replace,
                                OnSuccess = "ParamBgColorClear()",
                            }, new { @class = "btn btn-default" })
		                            .ToHtmlString().Replace("replacetxt", "<i class=\"icon-ban-circle\"></i> Cancelar"))
        </p>
    </fieldset>
    
}


@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/culturam")


